<div class="tableToolbar">
    <div class="coll-md-8" id="addInput">
        <div class="coll-md-15">
            <select class="form-control"  ui-select2="selectOptions" ng-model="ctrlScope.itemsearch.companyId"  required>
                <option value="">公司名称</option>
                <option ng-repeat="item in companyList" value="{{item.id}}">{{item.name}}</option>
            </select>
        </div>
        <div class="coll-md-1">
            <input type="button" class="small-icon search2-icon" value="搜索" ng-click="search()">
            <input type="button" class="small-icon search2" value="搜索">
            <input type="button" class="small-icon reset-icon" reset-icon value="重置" ng-click="reset()">
            <input type="button" class="small-icon reset" value="重置">
        </div>
    </div>
    <div class="coll-md-2">
        <input type="button" class="bttn pos-left" ng-click="addModal()" value="新增">
    </div>
</div>
<div style="width:100%;overflow-x: auto">
    <table ui-table="orderParams"  cellspacing="0px" style="border-collapse:collapse;">
        <thead>
        <tr>
            <th>ID</th>
            <th>公司名称</th>
            <th>押金</th>
            <th>比例</th>
            <th>总额度</th>
            <th>已使用额度</th>
            <th>添加时间</th>
            <th>添加IP</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <tr ng-repeat="item in orderParams.$rows">
            <td>{{item.id}}</td>
            <td>{{item.companyName}}</td>
            <td>{{item.deposit}}元</td>
            <td>{{item.rate}}</td>
            <td>{{item.totalAmount}}元</td>
            <td>{{item.usedAmount}}元</td>
            <td>{{item.addtime | date:"yyyy-MM-dd"}}</td>
            <td>{{item.addip}}</td>
            <td>
                <a ng-click="modifyBtn(item.id)">修改</a>
                <a ng-click="removeBtn(item.id)">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<modal title="额度管理" visible="detailModal">
    <form class="form-horizontal" name="myForm" novalidate>
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">公司名称<strong class="error" ng-if="myForm.companyId.$invalid">&nbsp;(必填)</strong></label>
                        <div class="col-md-8">
                            <select class="form-control" style="height: 34px !important;"  ui-select2="selectOptions" name="companyId" ng-model="add.companyId"  required>
                                <option value="">请选择</option>
                                <option ng-repeat="item in companyList" value="{{item.id}}">{{item.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">押金<strong class="error" ng-if="myForm.deposit.$invalid">&nbsp;(必填)</strong></label>
                        <div class="col-md-8 yuan">
                            <input type="text" required  class="form-control" ng-model="add.deposit"  name="deposit"
                                   maxlength="12"
                                   onkeyup="this.value=this.value.replace(/[^0-9]/g,'')"
                                   onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"/>
                            <div class="error" ng-show="add.deposit<0">
                                押金不能小于0
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">比例<strong class="error" ng-if="myForm.rate.$invalid">&nbsp;(必填)</strong></label>
                        <div class="col-md-8">
                            <input type="number" required  class="form-control" ng-model="add.rate"  name="rate" required/>
                            <div class="error" ng-show="add.rate<0 || add.rate>=1">
                                比例只能介于0和1之间
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue"  ng-disabled="myForm.$invalid" ng-click="addBtn()" style="float: right">提交</button>
            </div>
        </div>
    </form>
</modal>